package cn.javass.dp.strategy.mydemo1;

public enum CostsType {
    PACK_COSTS("0001","打包费用"),
    DISTRIBUTION_COSTS("0002","配送费用");

    private String code;
    private String msg;

    CostsType(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    //根据物流公司编码获取对应的名字
    public static CostsType getCompanyByCode(String code) {
        for (CostsType c : CostsType.values()) {
            if (c.getCode().equals(code)) {
                return c;
            }
        }
        return null;
    }


}
